import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node


def generate_launch_description():
    demo_nodes = IncludeLaunchDescription(
        PythonLaunchDescriptionSource(
            [
                get_package_share_directory("6_tf2_python"),
                "/3_tf2_动态广播_监听_launch.py",
            ],
        ),
        launch_arguments={"target_frame": "carrot1"}.items(),
    )

    return LaunchDescription(
        [
            demo_nodes,
            Node(
                package="6_tf2_python",
                executable="5_tf2_fixed_frame_boradcast_固定帧广播",
                name="fixed_broadcaster",
            ),
        ]
    )
